package com.liyong.pullorder.channels.dto;

import lombok.Data;

import java.util.List;

@Data
public class PullResponse {
    private boolean success;
    private String message;
    private List<StandardOrderDto> orders;

    public static PullResponse ok(List<StandardOrderDto> orders) {
        PullResponse r = new PullResponse();
        r.success = true;
        r.orders = orders;
        r.message = "OK";
        return r;
    }

    public static PullResponse fail(String msg) {
        PullResponse r = new PullResponse();
        r.success = false;
        r.message = msg;
        r.orders = java.util.Collections.emptyList();
        return r;
    }
}